package org.example.controller;

import cn.hutool.json.JSONObject;
import org.example.common.ResultData;
import org.example.service.ApiService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author itmei
 * @Date 2023/12/20 20:33
 * @description: 控制层
 * @Title: ApiController
 * @Package com.itmei.cicddemo.demos.controller
 */
@RestController
@RequestMapping("/api")
public class ApiController {
    @Resource
    private ApiService apiService;
    /**
     *
     * @return
     */
    @GetMapping("/cityWeatherDetails")
    public ResultData cityWeatherDetails(String city) {
        JSONObject realWeather = apiService.getRealWeather(city);
        return ResultData.success(realWeather);
    }
}


